﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.FactoryManagement;

namespace Digitalmes.Model.FactoryManagement
{
    /// <summary>
    /// 产线班次
    /// </summary>
	[Table("LineShift")]

    [Display(Name = "_Model.LineShift")]
    public class LineShift : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._LineShift._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._LineShift._Name")]
        [Comment("班次")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string Name { get; set; }
        [Display(Name = "_Model._LineShift._Code")]
        [StringLength(200, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("班次编码")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string Code { get; set; }
        [Display(Name = "_Model._LineShift._StartTime")]
        [Comment("开始时间")]
        [Required(ErrorMessage = "Validate.{0}required")]
       
        public DateTime? StartTime { get; set; }
        [Display(Name = "_Model._LineShift._EndTime")]
        [Comment("结束时间")]
        [Required(ErrorMessage = "Validate.{0}required")]
      
        public DateTime? EndTime { get; set; }
        [Display(Name = "_Model._LineShift._Hours")]
        [Comment("时长")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [Precision(18, 1)]
        public decimal? Hours { get; set; }
        [Display(Name = "_Model._LineShift._CrossDays")]
        [Comment("跨天")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool? CrossDays { get; set; }
        [Display(Name = "_Model._LineShift._Line")]
        [Comment("产线")]
        public ProductionLine Line { get; set; }
        [Display(Name = "_Model._LineShift._Line")]
        [Comment("产线")]
        public long? LineId { get; set; }
        [Display(Name = "_Model._LineShift._LineName")]
        [StringLength(200, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("产线名称")]
        public string LineName { get; set; }
        [Display(Name = "_Model._LineShift._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
